import money

money = 5000000
money = int(money)
name = None
name = input("请输入您的姓名")


def select(name):
    print("-----------------主查询余额-----------------")
    print(f"{name}，您好，您的剩余余额：{money}")
    return None


def cun(x):
    global money
    money += x
    print(f"{name},您好，您存款{x}元成功")
    print(f"{name}，您好，您的剩余余额：{money}")
    return money


def qu(x):
    money -= x
    print(f"{name},您好，您取款{x}元成功")
    print(f"{name}，您好，您的剩余余额：{money}")
    return money


def meau():
    print("-----------------主菜单-----------------")
    print(f"{name}，您好，欢迎来到ATM，请选择您的操作:")
    print("查询余额\t-请输入1")
    print("存款\t\t-请输入2")
    print("取款\t\t-请输入3")
    print("退出\t\t-请输入0")
    print("请选择您的操作")


while True:
    meau()
    y = int(input())
    if y == 1:
        select(name)
    elif y == 2:
        cun(int(input("请输入您要存款金额")))
    elif y == 3:
        qu(int(input("请输入您要取款金额")))
    else:
        print("程序退出！")
        break
